//
//  PDFPagePreviewView.m
//  Digital Seamonsters
//
//  Created by Adam Cue on 2/6/11.
//  Copyright Adam Cue 2011.
//
//  This program is licensed and distributed under the terms of the GNU General Public License.  
//	The text for the license can be found in the license.txt file in this project.
//

#import "PDFPagePreviewView.h"

@interface PDFPagePreviewView (Private)
#pragma mark UserActions
- (void)tapped;
@end

@implementation PDFPagePreviewView

@synthesize delegate;
@synthesize index;

- (id)initWithFrame:(CGRect)frame index:(int)selectedIndex {
   self = [super initWithFrame:frame];
   if (self) {
		self.index = selectedIndex;
      UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped)];
      [self addGestureRecognizer:tapGesture];
      [tapGesture release];
   }
   return self;
}

- (void)dealloc {
   self.delegate = nil;
   
   [super dealloc];
}

#pragma mark UserActions
- (void)tapped {
	[delegate selected:index];
}

@end
